/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package SPARQL;

import java.util.Objects;

/**
 *
 * @author dimartinomirko
 */
public class Binding {
    
    private Term term1;
    private Term term2;

    public Binding(Term term1, Term term2) {
        this.term1 = term1;
        this.term2 = term2;
    }

    public Term getTerm1() {
        return term1;
    }

    public void setTerm1(Term term1) {
        this.term1 = term1;
    }

    public Term getTerm2() {
        return term2;
    }

    public void setTerm2(Term term2) {
        this.term2 = term2;
    }

    @Override
    public String toString() {
        return "BIND("+ term1 + " as " + term2 + ')';
    }

    @Override
    protected Object clone() {
        return new Binding((Term)term1.clone(), (Term) term2.clone()); //To change body of generated methods, choose Tools | Templates.
    }

    @Override
    public int hashCode() {
        int hash = 3;
        hash = 73 * hash + Objects.hashCode(this.term1);
        hash = 73 * hash + Objects.hashCode(this.term2);
        return hash;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final Binding other = (Binding) obj;
        if (!Objects.equals(this.term1, other.term1)) {
            return false;
        }
        if (!Objects.equals(this.term2, other.term2)) {
            return false;
        }
        return true;
    }

   
    
    
    
}
